ENV["RAILS_ENV"] = "development"
require File.expand_path(File.dirname(__FILE__) + "/../../../config/environment")


require 'ftools'
require 'fileutils'

ROOT = "#{File.dirname(__FILE__)}/../../.."
PLUGIN_ROOT = File.dirname(__FILE__)
unless File.exists?(ROOT + "/public/javascripts/sound.js") 
  puts "======================================================================="
  FileUtils.cp(PLUGIN_ROOT+'/public/javascripts/sound.js', ROOT + "/public/javascripts/")
  puts "js-sound: Copied sound.js into public/javascripts."
  
  sounds_dir =  'public/sounds'
  dest = ROOT + "/"+sounds_dir
  FileUtils.mkdir_p(dest)
  puts "js-sound: Created #{sounds_dir} folder."
  
  FileUtils.cp_r(Dir.glob(PLUGIN_ROOT+'/'+sounds_dir+'/*.*'), dest)
  puts "js-sound: Copied sample sound effects into #{sounds_dir} folder."
  puts "======================================================================="
end